<template>
  <div id="app">
    <template v-if="route.path.startsWith('/user')">
      <router-view />
    </template>
    <template
      v-else-if="loginUserStore.loginUser.userRole === AccessEnum.ADMIN"
    >
      <ManagePage />
    </template>
    <template v-else>
      <BasicLayout />
    </template>
  </div>
</template>

<script setup>
import BasicLayout from "@/layouts/BasicLayout.vue";
import ManagePage from "@/layouts/ManagePage.vue";
import { userLoginUserStore } from "@/store/user";
import { useRoute } from "vue-router";
import AccessEnum from "@/access/accessEnum";
const route = useRoute();
const loginUserStore = userLoginUserStore();
loginUserStore.fetchLoginUser();
</script>

<style>
#app {
}
</style>
